package org.wz.complex.work.impl.auth.sysinfo;

import jakarta.annotation.Resource;

import org.springframework.stereotype.Service;

import org.wz.complex.work.bean.Abc;
import org.wz.complex.work.entity.auth.sysinfo.SysinfoMenu;
import org.wz.complex.work.entity.auth.sysinfo.SysinfoMicro;
import org.wz.complex.work.impl.base.BaseImpl;
import org.wz.complex.work.mapper.auth.sysinfo.SysinfoMenuMapper;
import org.wz.complex.work.mapper.auth.sysinfo.SysinfoMicroMapper;
import org.wz.complex.work.service.auth.sysinfo.SysinfoMenuService;



@Service
public class SysinfoMenuImpl extends BaseImpl<SysinfoMenuMapper, SysinfoMenu> implements SysinfoMenuService {

    @Resource
    private SysinfoMenuMapper mapper;

    @Resource
    private SysinfoMicroMapper sysinfoMicroMapper;

    @Override
    public Abc getAbc(Abc abc) {
        Abc res = mapper.getMenuByAbc(abc);
        // a
        if (null != res) {
            SysinfoMicro a = sysinfoMicroMapper.selectById(res.getAid());
            res.setMicro(a);
            res.setA(a.getRoute());
            res.setAname(a.getName());
            // b
            SysinfoMenu b = mapper.selectById(res.getBid());
            res.setModule(b);
            res.setB(b.getUrl());
            res.setBname(b.getName());
            // c
            SysinfoMenu c = mapper.selectById(res.getCid());
            res.setEntity(c);
            res.setC(c.getUrl());
            res.setCname(c.getName());
        }
        // return
        return res;
    }


}
